﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MachineVision.Core.TemplateMatch.Shared;

namespace MachineVision.Core.TemplateMatch.ShapeModel
{
    /// <summary>
    /// 形状匹配运行参数
    /// </summary>
    public class ShapeModelRunParameter : BaseParameter
    {
        public ShapeModelRunParameter() : base()
        {

        }
        public override void ApplyDefaultParameter()
        {
            AngleStart = -0.39;
            AngleExtent = 0.79;
            MinScore = 0.5;
            NumMatches = 1;
            MaxOverlop = 0.5;
            SubPixel = "least_squares";
            NumLevels = 0;
            Greediness = 0.9;
        }


        private double numLevels;
        private double angleStart;
        private double angleExtent;
        private double minScore;
        private double greediness;
        private string subPixel;
        private double maxOverlop;
        private int numMatches;

        /// <summary>
        /// 最大匹配个数
        /// </summary>
        public int NumMatches { get => numMatches; set { numMatches = value; RaisePropertyChanged(); } }
        /// <summary>
        /// <summary>
        /// 最大重叠率
        /// </summary>
        public double MaxOverlop { get => maxOverlop; set { maxOverlop = value; RaisePropertyChanged(); } }
        /// <summary>
        /// 金字塔层数
        /// </summary>
        public double NumLevels { get => numLevels; set { numLevels = value; RaisePropertyChanged(); } }
        /// <summary>
        /// 模板旋转起始角度
        /// </summary>
        public double AngleStart { get => angleStart; set { angleStart = value; RaisePropertyChanged(); } }
        /// <summary>
        /// 模板旋转角度范围
        /// </summary>
        public double AngleExtent { get => angleExtent; set { angleExtent = value; RaisePropertyChanged(); } }
        /// <summary>
        /// 最小匹配分数
        /// </summary>
        public double MinScore { get => minScore; set { minScore = value; RaisePropertyChanged(); } }
        /// <summary>
        /// 贪婪程度
        /// </summary>
        public double Greediness { get => greediness; set { greediness = value; RaisePropertyChanged(); } }
        /// <summary>
        /// 精度设置
        /// </summary>
        public string SubPixel { get => subPixel; set { subPixel = value; RaisePropertyChanged(); } }
    }
}
